package com.itheima.health.dao;

import com.itheima.health.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

@Mapper
public interface MemberDao {

    @Select("select * from t_member where phoneNumber = #{phoneNumber}")
    Member selectByPhoneNumber(@Param("phoneNumber") String phoneNumber);

    void updateByIdSelective(Member member);

    void add(Member member);
    @Select("select * from t_member where id = #{id}")
    Member selectById(@Param("id") Integer id);

    //查询这个月前所有会员数量

    Integer getMemberCount(@Param("mouth") String mouth);

    Long countByRegTimeRange(@Param("startDate") Date startDate,@Param("endDate") Date endDate);

    Long countByRegTimeBefore(@Param("endDate") String endDate);
}
